<template>
    <div>

    </div>
</template>

<script>
export default {

}
// 路由跳转之前
router.router.beforeEach((to, from, next) => {
    let isLogin = sessionStorage.getItem('isLogin');
    //    注销
    if (to.path == '/logout') {
        // 清空
        sessionStorage.clear();
        // 跳转到登录页面
        next({ path: '/login' });
    } else if (to.path == 'login') {
        判断是否为空, 不为空, 跳转至首页
        if (isLogin != null) {
            next({ path: '/math' });
        }
    } else if (isLogin == null) {
        next({ path: '/login' });
    }
    next();

});
</script>

<style lang="scss" scoped></style>